      Subroutine Convergence_Print(Kcrit,Gmaxa)
	
      Use Constant,          ONLY: Icdat,Icout
      Use Global_Variables,  ONLY: Mphas
    
      Implicit None
      Integer Ncrit,Kcrit
      Double Precision Gmaxa(Mphas)
      Integer Iphas
      Character Ttemp*72
      Logical CharacterComparison,Rokay
      External CharacterComparison
      Ncrit=Mod(Kcrit,10)

      Write(Icout,'(72(1h-))')
      Goto (1110,1120,1130,1140,1150),Ncrit
		  Write(Icout,*)'Current Increment Of Incremental Alpha',' Norm Versus Maximum Alpha Norm'
		  Goto 1900
 1110 Continue
		  Write(Icout,*)'Current Increment Of Incremental Alpha',' Norm Versus Current Alpha Norm'            
		  Goto 1900
 1120 Continue
		  Write(Icout,*)'Current Increment Of Incremental Alpha',' Norm Versus Average Alpha Norm'            
           Goto 1900
 1130 Continue
!.... Definition Changed On 12-Sep-1990
		  Write(Icout,*)'Current Increment Of Incremental Alpha',' Norm Versus Average Root Square Alpha Norm'            
          Goto 1900
 1140 Continue
		  Read (Icdat,'(A)')Ttemp
		  Print *,'Number Of Phases Is Now:',Mphas
          If (.Not.CharacterComparison(Ttemp(1:6),'Gmaxa:')) Then
              Write(Icout,*)'Convergence_Print-1: Error Gmaxa: Not Found In Input'
              Write(Icout,*)Ttemp
              Call Termination( 'Stopped In Convergence_Print Due To Gmaxa:')
         Else
             Read (Ttemp(7:),*)(Gmaxa(Iphas),Iphas=1,Mphas)
             Write(Icout,*)'Current Average Root Square Residual' ,' Force Norm Versus Fixed Force Norm' 						
			 Write(Icout,'(1x,5g14.6)')(Gmaxa(Iphas),Iphas=1,Mphas)
		  End If
          Goto 1900
 1150 Continue
         Write(Icout,*)'Current Average Root Square Residual',' Force Norm Versus Maximum Of The Same Norm'                     
         Print *,'Number Of Phases Is Now:',Mphas
         Call Keyword_Read('Gmini:',Icdat,Icout,Ttemp,Rokay,0)
         If (Rokay) Then
             Read (Ttemp(7:),*)(Gmaxa(Iphas),Iphas=1,Mphas)
         Else
             Call Give_Value(Gmaxa,Mphas,0.0D0)
         End If
         Write(Icout,'(1x,5g14.6)')(Gmaxa(Iphas),Iphas=1,Mphas)

         Goto 1900
		 
 1900 Continue
         If (Mod(Kcrit/10,10).Eq.1)Write(Icout,*)'At Least 1 Iteration'
      
	  Return
	  End
	  

      Subroutine Convergence_Check(Iconv,Kcrit,Errmx,Fcura,Fconv,Gmaxa,Tolmx)					              

!     Subroutine To Print And Check The Convergence Criteria
!     The Maximum Of All Phases Is Used
!     Convergence_Print: Print Out The Name Of The Criteria Used
!     Conver: Check The Criteria
!     Ncrit = Mod(Kcrit,10)
!     Iconv: 0 Not Converged
!            1 Converged
!            2 Smaller Time Step
!            3 Bigger Time Step
!            4 The Error Norm Is Larger Than Tolmx
	  
      Use Constant,          ONLY: Icout,Icdat
      Use Global_Variables,  ONLY: Mphas,Amaxa,Bcura,Acura,Toler,Anom1,Anom2,   &
                                   Normc,I_Iteration  
      
      Implicit None
!.... Input Variables:
      Integer Ncrit,Kcrit
      Double Precision Fcura(Mphas),Tolmx

	  !.... Output Variables:
      Integer Iconv
      Double Precision Errmx(Mphas),Fconv(Mphas),Gmaxa(Mphas)

	  !.... Local Variables:
      Integer Iphas
      Double Precision Real0,Real2,Denom
      Character Ttemp*72
      Parameter (Real0=0.0D0,Real2=2.0D0)
      Double Precision Bigno,Bign2
      Parameter (Bigno=1.0D15,Bign2=Bigno*Bigno)
      Logical CharacterComparison,Rokay
      External CharacterComparison
	  
      Ncrit=Mod(Kcrit,10)	  
	  
!.... Check For Convergence
      Do Iphas=1,Mphas
		 Goto (1201,1202,1203,1204,1205),Ncrit
         If (Normc.Eq.0) Goto 1201
         Denom=Amaxa(Iphas)
         Fconv(Iphas)=Bcura(Iphas)
         Goto 1280
 1201    Continue
            Denom=Acura(Iphas)
			Fconv(Iphas)=Bcura(Iphas)
            Goto 1280
 1202    Continue
            If (Normc.Eq.0) Goto 1201
            Denom=Anom1(Iphas)/Dble(Normc)
		    Fconv(Iphas)=Bcura(Iphas)
            Goto 1280
 1203    Continue
            If (Normc.Eq.0) Goto 1201
            Denom=Sqrt(Anom2(Iphas))/Dble(Normc)
            Fconv(Iphas)=Bcura(Iphas)
            Goto 1280
 1205    Continue

 1204    Continue
            Denom=Gmaxa(Iphas)
            Fconv(Iphas)=Fcura(Iphas)
            Goto 1280
 1280    Continue
            If (Abs(Denom).Le.Real0) Then
		       If (Abs(Fconv(Iphas)).Le.Real0) Then
			      Errmx(Iphas)=Toler
			   Else
				  Write(Icout,*)'Norm Is Zero For Iphas:',Iphas
			      Errmx(Iphas)=Toler*Real2
			   End If
		    Else
               Errmx(Iphas)=Fconv(Iphas)/Denom
            End If
	  End Do
	  
      Iconv=1
!.... Consider The Useful Phases Only (11-Jul-88)
      Do Iphas=1,Mphas
         If (Errmx(Iphas).Gt.Tolmx) Then
            Iconv=4
         Else If (Errmx(Iphas).Gt.Toler.And.Iconv.Eq.1) Then
            Iconv=0
         End If
      End Do
!.... At Least 1 Iteration
      If (Mod(Kcrit/10,10).Eq.1.And.I_Iteration.Eq.0) Iconv=0
      If (Iconv.Eq.1) Then
!.... Update The Cumulative Norms
         Normc=Normc+1
         Do Iphas=1,Mphas
            If (Fcura(Iphas).Gt.Gmaxa(Iphas).And.Ncrit.Eq.5) Then
               Write(Icout,*)'Force Norm Update Iphas,Norm:',Iphas,Fcura(Iphas)                  
               Gmaxa(Iphas)=Fcura(Iphas)
            End If
               Amaxa(Iphas)=Max(Amaxa(Iphas),Acura(Iphas))
               Anom1(Iphas)=Anom1(Iphas)+Acura(Iphas)
               Anom2(Iphas)=Anom2(Iphas)+Min(Bigno,Abs(Acura(Iphas)))**2
               Anom2(Iphas)=Min(Bign2,Anom2(Iphas))
		 End Do
	  End If
	  
      Return
      End